#!/bin/bash
i_day=$1 || i_day=1
gday=`date --date="${i_day} days ago" +%F`
mkdir /data/logs/disp/${gday}
cd /root/python/disp_deap/
/root/anaconda3/envs/disp/bin/python 1.1.exp_orders.py ${i_day} > /data/logs/disp/${gday}/exp_orders.log
sleep 1
/root/anaconda3/envs/disp/bin/python 1.2.exp_inventory.py ${i_day} > /data/logs/disp/${gday}/exp_inventory.log
sleep 1
for ((i_city = 1; i_city <= 3; i_city++))
do
    echo "start optimize city ${i_city}"
    for ((i_cate = 1; i_cate <= 3; i_cate++))
    do
        nohup /root/python/disp_deap/run_v3 ${i_city} ${i_cate} ${i_day} > /data/logs/disp/${gday}/run_v3_${i_city}_${i_cate}.log 2>&1 &
    done
    sleep 1
done
